﻿package org.aquiferserver.client.flex
{
	import org.aquiferserver.client.flex.logging.Log;
	import org.aquiferserver.client.flex.logging.LogFactory;
	import org.aquiferserver.common.MessageType;
	import org.aquiferserver.client.flex.MessageHandler;
	/**
	 * ...
	 * @author Seth Albanese
	 * @version $Id: MessageHandlerFactory.as 60 2009-06-15 08:47:09Z salbanese0080@gmail.com $
	 */
	public class MessageHandlerFactory 
	{
		public static var logger:Log = LogFactory.getLog( "org.aquiferserver.client.flex.MessageHandlerFactory" );
		
		public static function getMessageHandler( type:MessageType ) : MessageHandler
		{
			switch( type.type )
			{
				case MessageType.MT_HANDSHAKE.type:
					return new HandshakeMessageHandler();
				break;
				
				case MessageType.MT_HANDSHAKE_CONFIRM.type:
					return new HandshakeConfirmationMessageHandler();
				break;
			}
			
			return null;
		}
	}
	
}